package com.ss.android.article.base.feature.user.social;

import android.view.View;
import java.util.Iterator;

final class a implements View.OnClickListener {
    private final ReportActivity a;

    a(ReportActivity arg1) {
        this.a = arg1;

    }

    public final void onClick(View arg7) {
        Iterator v4;
        int v5 = View.INVISIBLE;
        int v3 = -1;
        if(!this.a.q && arg7 != null) {
            if(arg7.isSelected()) {
                ReportActivity v1 = this.a;
                v4 = v1.c.iterator();
                while(v4.hasNext()) {
                    ((View)v4.next()).setSelected(false);
                }

                v1.a = v3;
                v1.b.setVisibility(v5);
                v1.mRightBtn.setEnabled(false);
                v1.b.clearFocus();
                v1.o.hideSoftInputFromWindow(v1.b.getWindowToken(), 0);
            }
            else {
                v4 = this.a.c.iterator();
                while(v4.hasNext()) {
                    ((View)v4.next()).setSelected(false);
                }

                boolean v0 = !arg7.isSelected() ? true : false;
                arg7.setSelected(v0);
                Object v0_1 = arg7.getTag();
                int v0_2 = (v0_1 instanceof Integer) ? ((Integer)v0_1).intValue() : v3;
                if(v0_2 < 0) {
                    return;
                }

                this.a.a = v0_2;
                if(this.a.a == 0) {
                    this.a.b.setVisibility(View.VISIBLE);
                    if(android.support.design.a.isTextEmpty(this.a.b.getText().toString())) {
                        ReportActivity.a(this.a).setEnabled(false);
                    }
                    else {
                        ReportActivity.b(this.a).setEnabled(true);
                    }

                    this.a.b.requestFocus();
                    this.a.o.showSoftInput(this.a.b, 0);
                    this.a.a();
                    return;
                }

                this.a.b.setVisibility(v5);
                ReportActivity.c(this.a).setEnabled(true);
                this.a.b.clearFocus();
                this.a.o.hideSoftInputFromWindow(this.a.b.getWindowToken(), 0);
            }
        }
    }
}

